home *** CD-ROM | disk | FTP | other *** search
- global onIBM, theQTMovie, gStartVolume, gmasterfolderpath, gDelimiter, gFileName, theBlitPict, theSparkle, objPreview, objIndexBtn, objalphabetbtn, objChapterBtn, objVolumeBtn, objCaptureGrid, objCapturePict
-
- on startMovie
- watchon()
- repeat with n = 1 to 48
- set the visible of sprite n to 0
- end repeat
- updateStage()
- watchon()
- openingupsetting()
- watchon()
- setindexprop()
- initialsetting()
- setMenu()
- setIndexBtn()
- watchon()
- end
-
- on stopMovie
- if objectp(theQTMovie) then
- QTPause(theQTMovie)
- QTDispose(theQTMovie)
- end if
- repeat with n = 1 to 48
- set the visible of sprite n to 0
- set the puppet of sprite n to 0
- end repeat
- updateStage()
- importFileInto(cast 1, gmasterfolderpath & "GRAPHIC" & gDelimiter & "QUIT.PCT")
- set the regPoint of cast 1 to point(the width of cast 1 / 2, the height of cast 1 / 2)
- go("logo")
- set the visible of sprite 1 to 1
- updateStage()
- startTimer()
- repeat while the timer < 120
- end repeat
- killpreview()
- killsparkle(theSparkle)
- killCaptureGrid()
- killIndexBtn()
- if onIBM then
- closeXLib("FILEIO.DLL")
- closeXLib("BLITPICT.DLL")
- closeXLib("BATQT.DLL")
- end if
- set gStartVolume to the soundLevel
- clearGlobals()
- end
-
- on startOver
- repeat with n = 48 down to 1
- set the visible of sprite n to 0
- set the puppet of sprite n to 0
- end repeat
- updateStage()
- killpreview()
- if objectp(theQTMovie) then
- QTDispose(theQTMovie)
- end if
- killsparkle(theSparkle)
- killCaptureGrid()
- killIndexBtn()
- set objPreview to EMPTY
- set theBlitPict to EMPTY
- set theSparkle to EMPTY
- set theQTMovie to EMPTY
- set objIndexBtn to EMPTY
- set objalphabetbtn to EMPTY
- set objChapterBtn to EMPTY
- set objVolumeBtn to EMPTY
- set objCapturePict to EMPTY
- set objCaptureGrid to EMPTY
- if onIBM then
- closeXLib("FILEIO.DLL")
- closeXLib("BLITPICT.DLL")
- closeXLib("BATQT.DLL")
- end if
- put "." into field 32
- put "." into field 33
- put "." into field 34
- put "." into field 37
- put "." into field 35
- clearGlobals()
- unLoadCast()
- end
-
- on openingupsetting
- global glessonlist, glessonnumber, objChapterBtn, gChapterBtnLocList, objVolumeBtn, gVolumeBtnLocList, gallchapterlist, galllessonlist, gKeywordDataList, gkeywordtext, gAlphabetExist
- set the exitLock to 1
- set the keyDownScript to "filterQuit"
- set gStartVolume to the soundLevel
- if the machineType = 256 then
- set onIBM to 1
- set gDelimiter to "\"
- set gFileName to [:]
- addProp(gFileName, #INITXT, "INI.TXT")
- addProp(gFileName, #PREVIEW, "GRAPHIC\PREVIEW.BMP")
- addProp(gFileName, #sparkle, "GRAPHIC\SPARKLE.BMP")
- addProp(gFileName, #INDEXBTN, "GRAPHIC\INDEXBTN.BMP")
- addProp(gFileName, #INTROP, "INTRO.BMP")
- addProp(gFileName, #INTROM, "INTRO.MOV")
- addProp(gFileName, #IFTXT, "GRAPHIC\IF.TXT")
- addProp(gFileName, #Alphabet, "GRAPHIC\ALPHADN.BMP")
- openXLib("FILEIO.DLL")
- openXLib("BLITPICT.DLL")
- openXLib("BATQT.DLL")
- set objPreview to birth(script "blitPict parent for MPC")
- set theBlitPict to birth(script "blitPict parent for MPC")
- set theSparkle to birth(script "sparkle parent for MPC")
- set theQTMovie to birth(script "batQT parent for MPC")
- set objIndexBtn to birth(script "blitPict parent for MPC")
- set objalphabetbtn to birth(script "blitPict parent for MPC")
- set objCapturePict to birth(script "blitPict parent for MPC")
- set objCaptureGrid to birth(script "blitPict parent for MPC")
- else
- set onIBM to 0
- set gDelimiter to ":"
- set gFileName to [:]
- addProp(gFileName, #INITXT, "INI.TXT")
- addProp(gFileName, #PREVIEW, "GRAPHIC:PREVIEW.PCT")
- addProp(gFileName, #sparkle, "GRAPHIC:SPARKLE.PCT")
- addProp(gFileName, #INDEXBTN, "GRAPHIC:INDEXBTN.PCT")
- addProp(gFileName, #INTROP, "INTRO.PCT")
- addProp(gFileName, #INTROM, "INTRO.MOV")
- addProp(gFileName, #IFTXT, "GRAPHIC:IF.TXT")
- addProp(gFileName, #Alphabet, "GRAPHIC:ALPHADN.PCT")
- set objPreview to birth(script "blitPict parent for Mac")
- set theBlitPict to birth(script "blitPict parent for Mac")
- set theSparkle to birth(script "sparkle parent for Mac")
- set theQTMovie to birth(script "QTMovie parent for Mac")
- set objIndexBtn to birth(script "blitPict parent for Mac")
- set objalphabetbtn to birth(script "blitPict parent for Mac")
- set objCapturePict to birth(script "blitPict parent for Mac")
- set objCaptureGrid to birth(script "blitPict parent for Mac")
- end if
- fileIOread(the pathName & getProp(gFileName, #INITXT))
- set initxtfile to the result
- if item 3 of line 1 of initxtfile = EMPTY then
- set external to 0
- else
- set external to integer(item 3 of line 1 of initxtfile)
- end if
- if onIBM then
- if the controlDown or (external <> 0) then
- set thePath to line 2 of initxtfile
- set the itemDelimiter to ":"
- openXLib("LabelDrv")
- set objLabelDrv to LabelDrv(mnew)
- objLabelDrv(mSetRange, "A", "Z")
- set driveName to objLabelDrv(mGetDrive, item 1 of thePath)
- objLabelDrv(mdispose)
- closeXLib("LabelDrv")
- set gmasterfolderpath to char 1 of driveName & ":\"
- repeat with n = 2 to the number of items in thePath - 1
- put item n of thePath & "\" after gmasterfolderpath
- end repeat
- set the itemDelimiter to ","
- else
- set thePath to line 2 of initxtfile
- set the itemDelimiter to ":"
- set thefoldername to item the number of items in thePath - 1 of thePath
- set gmasterfolderpath to the pathName & thefoldername & "\"
- set the itemDelimiter to ","
- end if
- else
- if the controlDown or (external <> 0) then
- set gmasterfolderpath to line 2 of initxtfile
- else
- set thePath to line 2 of initxtfile
- set the itemDelimiter to ":"
- set thefoldername to item the number of items in thePath - 1 of thePath
- set gmasterfolderpath to the pathName & thefoldername & ":"
- set the itemDelimiter to ","
- end if
- end if
- fileIOread(gmasterfolderpath & "PREP1.TXT")
- set glessonlist to the result
- set glessonnumber to the number of lines in glessonlist
- set the text of cast 32 to glessonlist
- set objGraphic to birth(script "parent <change graphic>")
- importGraphic(objGraphic, external)
- set objGraphic to EMPTY
- set objChapterBtn to birth(script "Parent<Slider>", gChapterBtnLocList, 13)
- set objVolumeBtn to birth(script "Parent<Slider>", gVolumeBtnLocList, 14)
- slideListSet(objVolumeBtn, 8)
- fileIOread(gmasterfolderpath & "PREP2.TXT")
- set galllessonlist to getAt(value(the result), 1)
- set gallchapterlist to getAt(value(the result), 2)
- fileIOread(gmasterfolderpath & "PREP3.TXT")
- set gkeywordtext to the result
- fileIOread(gmasterfolderpath & "PREP4.TXT")
- set gKeywordDataList to getAt(value(the result), 1)
- set gAlphabetExist to getAt(value(the result), 2)
- end
-
- on initialsetting
- global gPauseMode, gcurrlessonnumber, gcurrchapternumber, gchapternumber, gstartupflag, theSparkle, gPICTQTList
- set gPauseMode to 1
- setpreview()
- set gcurrlessonnumber to 1
- set gcurrchapternumber to 1
- set gchapternumber to getchapternumber(gcurrlessonnumber)
- set gstartupflag to 1
- loadsparkle(theSparkle)
- set gPICTQTList to []
- set pictscreenlist to []
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 2, 1, 1, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 2, 0, 2, 2, 2, 1, 1, 1, 0, 1])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
- add(pictscreenlist, [0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 0, 2])
- set prevclrlist to []
- add(prevclrlist, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
- add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
- add(prevclrlist, [3, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 2, 2])
- add(prevclrlist, [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
- add(prevclrlist, [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
- add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
- add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
- add(prevclrlist, [3, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
- add(prevclrlist, [3, 1, 3, 2, 3, 1, 1, 1, 0, 1, 2, 0, 2, 2, 2])
- add(prevclrlist, [2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 0, 2, 2, 2])
- add(prevclrlist, [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
- add(prevclrlist, [3, 1, 3, 2, 3, 1, 1, 1, 0, 1, 2, 0, 2, 2, 2])
- add(prevclrlist, [3, 1, 1, 2, 3, 1, 1, 1, 0, 1, 2, 0, 0, 2, 2])
- add(prevclrlist, [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
- add(prevclrlist, [0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0])
- set smallscreenlist to [1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0]
- set gPICTQTList to [pictscreenlist, prevclrlist, smallscreenlist]
- end
-
- on setindexprop
- global galllessonlist, gindexmaplist, pushBtn, ggridlist, gMaxKwdFld, gSelLine, glastline, gkeywordtext, gSpliteSetList
- set gindexmaplist to []
- repeat with n = 1 to count(galllessonlist)
- set theparagraphno to getAt(getAt(galllessonlist, n), 2)
- set indexMapList to []
- if theparagraphno <> 0 then
- setAt(indexMapList, theparagraphno, 0)
- end if
- add(gindexmaplist, indexMapList)
- end repeat
- set the text of cast 35 to the text of cast 32
- set the text of cast 34 to line 1 to 24 of gkeywordtext
- set indexbtnsize to 12
- set maxh to 27
- set maxv to 23
- set originx to 151
- set originy to 114
- set captureArea to originx & "," & originy & "," & originx + (indexbtnsize * maxh) & "," & originy + (indexbtnsize * maxv)
- set theHalf to float(indexbtnsize / 2)
- set theHalfLeft to originx - theHalf
- set theHalfTop to originy - theHalf
- set ggridlist to [originx, originy, maxh, maxv, indexbtnsize, captureArea, theHalfLeft, theHalfTop]
- set gMaxKwdFld to 24
- set gSelLine to 0
- set glastline to the number of lines in gkeywordtext
- if glastline > gMaxKwdFld then
- add(gSpliteSetList, [26, 37, 28, 29, 30, 31, 32, 33, 35, 36])
- add(gSpliteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
- else
- add(gSpliteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
- add(gSpliteSetList, [26, 37, 28, 29, 32, 33, 35, 36])
- end if
- end
-
- on fileIOwrite thePath, theText
- if objectp(objfileio) then
- objfileio(mdispose)
- end if
- set objfileio to FileIO(mnew, "write", thePath)
- if objectp(objfileio) then
- objfileio(mWriteString, theText)
- objfileio(mdispose)
- else
- alert(thePath && "write error")
- end if
- end
-
- on fileIOread thePath
- if objectp(objfileio) then
- objfileio(mdispose)
- end if
- set objfileio to FileIO(mnew, "read", thePath)
- if objectp(objfileio) then
- set theText to objfileio(mReadFile)
- objfileio(mdispose)
- else
- alert(thePath && "read error")
- quit()
- end if
- return theText
- end
-